package iceberg.readers;

import iceberg.Config;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;

abstract class 	AbstractReader {
	Element getXMLRootOfFile(String fileName) throws SAXException, IOException, ParserConfigurationException {
		Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(Config.getConfigDirectory(), fileName));
		return document.getDocumentElement();
	}

}
